<?php
/**
 * Created by PhpStorm.
 * User: apple
 * Date: 2018/7/24
 * Time: 下午10:28
 */
namespace PddWechat\Models\Pos\Dao;
use Dai\Framework\Base\BaseDao;
use PddWechat\Models\Pos\DataObject\PosActivateDo;

/**
 * Class PostInvateDao
 * @dataObject(\PddWechat\Models\Pos\DataObject\PosActivateDo)
 * @package PddWechat\Models\Pos\Dao
 */
class PosActivateDao extends BaseDao
{
    public function insert(PosActivateDo $posActivateDo) {
        $posActivateDo->id = $this->execute("user.pos_activate.insert",$posActivateDo);
        return $posActivateDo;
    }

    public function select($orderNum) {
        $param = [
            'orderNum' => $orderNum,
            'select' => '*',
        ];
        $res = $this->execute("user.pos_activate.select_by_ordernum", $param);
        if( count($res) > 0 ) {
            /** @var PosActivateDo $ret */
            $ret = $this->trimBase($res[0]);
            return $ret;
        }
        return null;
    }
}